<!DOCTYPE html>
<html>
<head>
<?php include(__DIR__ . '/../Public/header.php'); ?>
<style type="text/css"></style>
<script type="text/javascript" >
var fee = parseFloat("<?=$fee?$fee:0?>");
var min_withdraw_num = parseFloat("<?=$min_withdraw_num?$min_withdraw_num:100?>");
</script>
</head>
<body class="skin-black fixed">
<?php include(__DIR__ . '/../Public/nav.php'); ?>
<div class="wrapper row-offcanvas row-offcanvas-left">
    <?php include(__DIR__ . '/../Public/left.php'); ?>
    <aside class="right-side">
        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-md-12">
                    <ul class="breadcrumb">
                        <li><a href="#"><i class="fa fa-home"></i> <?=L('ucenter',1)?></a></li>
                        <li class="active"><?=L('withdraw',1)?></li>
                    </ul>
                </div>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <section class="panel">
                        <header class="panel-heading"><?=L('withdrawal_amount')?>：<b class="text-success"><?=number_format($account['rmb'],2,'.','')?></b>，<?=L('withdrawal_fee')?>：<b class="text-danger"><?=$fee?>%</b>，<?=L('withdrawal_confirm')?></header>
                        <div class="panel-body">
                            <form class="form-horizontal tasi-form withdraw-form" data-action='<?=url('ucenter/out')?>' onsubmit="return false;" >
                                <div class="form-group">
                                    <label class="col-sm-2 col-sm-2 control-label"><?=L('bank_card',2)?></label>
                                    <div class="col-sm-10">
                                        <select class="form-control" id="bank_id">
                                            <?php foreach ($bank as $key =>$value) { ?>
                                            <option value="<?=$value['bank_id']?>"><?=$value['bank_name']?> <?=hideStr($value['card_num'],0,4,4)?> <?=$value['card_name']?></option>
                                            <?php } ?>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 col-sm-2 control-label"><?=L('money',2)?></label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" id='withdraw_num' placeholder="0.00" data-rule-required="true" data-rule-number="true" data-rule-minlength="3" nullmsg='请输入您的提现金额！'>
                                        <span class='text-danger Validform_checktip'></span>
                                        <span class="help-block"><?=L('money',2)?>：<b class="text-success" id='all_money'>0.00</b>，<?=L('fee',2)?>：<b class="text-danger" id='out_fee'>0.00</b>，<?=L('final',2)?>：<b class="text-primary" id='money'>0.00</b></span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-lg-offset-2 col-lg-10">
                                        <button type="submit" class="btn btn-danger" ><?=L('ok',2)?></button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </section>
                </div>
            </div>
        <!-- row end -->
        </section><!-- /.content -->

        <?php include(__DIR__ . '/../Public/copyright.php'); ?>
    </aside><!-- /.right-side -->
</div><!-- ./wrapper -->
<div aria-hidden="true" role="dialog" tabindex="-1" id="Auth" class="modal fade">
    <div class="modal-dialog" >
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title"><?=L('auth',1)?></h4>
            </div>
            <form class="withdraw-rmb-auth" role="form" data-action='<?=url('ucenter/out')?>' onsubmit="return false;">
            <div class="modal-body">
                <div class="form-group googleInput">
                    <label><?=L('google_code',2)?></label>
                    <input type="text" class="form-control" name='info[google_code]' id='googleCodeInput' data-rule-required="true" data-rule-number="6" placeholder="<?=L('google_code',2)?>">
                </div>
                <div class="form-group emailInput">
                    <label><?=L('email_code',2)?></label>
                    <input type="text" class="form-control" name='info[email_code]' id='emailCodeInput' data-rule-required="true" data-rule-rangelength="[8,8]" placeholder="<?=L('email_code',2)?>">
                </div>
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-danger" ><?=L('ok',2)?></button>
            </div>
            </form>
        </div>
    </div>
</div>
<?php include(__DIR__ . '/../Public/footer.php'); ?>
<script type="text/javascript" >
$(function(){
    $('#withdraw_num').on('keyup',function(){
        var me = $(this);
        var allMoney = me.val();
        if(allMoney){
            var out_fee = allMoney*(fee/100);
            var money = accSub(allMoney,out_fee);
            $('#all_money').html(formatMoney(allMoney,2,'',''));
            $('#out_fee').html(formatMoney(out_fee,2,'',''));
            $('#money').html(formatMoney(money,2,'',''));
        }
    })
})
</script>
</body>
</html>